package xyz.xtt.exchange.anno;

import java.lang.reflect.Method;

import org.springframework.stereotype.Component;

import jakarta.annotation.Resource;
import xyz.xtt.exchange.service.impl.MyCustomService;

@Component
public class MyCustomAnnotationProcessor {

	@Resource
	private MyCustomService myCustomService;

	public void processAnnotations(Object bean) {
		Class<?> clazz = bean.getClass();
		for (Method method : clazz.getDeclaredMethods()) {
			if (method.isAnnotationPresent(MyCustomAnnotation.class)) {
				MyCustomAnnotation annotation = method.getAnnotation(MyCustomAnnotation.class);
				// 执行某些操作
				myCustomService.performOperation(annotation.value());
			}
		}
	}
}
